import lazyLoadView from '@/router/lazy-load';
import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const MedicationManagement: AppRouteRecordRaw = {
  path: '/medication-management',
  name: 'MedicationManagement',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.medication',
    requiresAuth: true,
    icon: 'icon-experiment',
    order: 4,
    roleCode: 'GROUP_DRUG_ADMIN',
  },
  children: [
    {
      path: 'drug-information',
      name: 'DrugInformation',
      component: lazyLoadView(
        () => import('@/views/medication-management/drug-information/index.vue')
      ),
      meta: {
        locale: 'menu.medication.drugInformation',
        requiresAuth: true,
        roleCode: 'GROUP_DRUG',
        pageName: '药品列表',
      },
    },
    {
      path: 'drug-inventory',
      name: 'DrugInventory',
      component: lazyLoadView(
        () => import('@/views/medication-management/drug-inventory/index.vue')
      ),
      meta: {
        locale: 'menu.medication.drugInventory',
        requiresAuth: true,
        roleCode: 'GROUP_ELDER_DRUG',
        pageName: '库存列表',
      },
    },
    {
      path: 'medication-plan',
      name: 'MedicationPlan',
      component: lazyLoadView(
        () => import('@/views/medication-management/medication-plan/index.vue')
      ),
      meta: {
        locale: 'menu.medication.medicationPlan',
        requiresAuth: true,
        roleCode: 'GROUP_MED_SCHEDULE',
        pageName: '计划列表',
      },
    },
  ],
};

export default MedicationManagement;
